﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace DomainDriver.Presentation.Silverlight.Base
{
    public static class UiConfiguration
    {
        private static IApplicationObject s_ApplicationObject;

        static UiConfiguration()
        {
            s_ApplicationObject = null;
        }

        public static bool HasApplicationObject
        {
            get { return (s_ApplicationObject != null); }
        }

        public static IApplicationObject ApplicationObject
        {
            get { return s_ApplicationObject; }
            set
            {
                if (HasApplicationObject)
                { throw new InvalidOperationException("Can only set ApplicationObject once."); }
                if (value == null)
                { return; }

                s_ApplicationObject = value;
            }
        }
    }
}